package LoginPackage;

import static org.testng.AssertJUnit.assertEquals;

import org.testng.annotations.*;

import PagePackage.MyPageFactory;
import PagePackage.internalPageClass;
import PagePackage.loginPageClass;

@Test (priority=0)
public class LoginClass extends TestBaseClass{

  
  public void SuccessfulLogin() {
	  goToMainPage(); 
	  MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@krossover.com", "webmaster");
	  assertEquals("Admin", internalPage.roleName.getText()); 
	  MyPageFactory.getPage(driver, internalPageClass.class).logout();
	
	
		
	  }

  
  
  public void WrongPassword() {
	   
	  goToMainPage();
	  MyPageFactory.getPage(driver, loginPageClass.class).loginWithWrongCredentials("victoria@krossover.com", "123");
	  assertEquals("Wrong password, try again.", loginPage.errorWrongPassword.getText());
		
	
  
}
 
  public void WrongEmail() {
	 goToMainPage();
	 MyPageFactory.getPage(driver, loginPageClass.class).loginWithWrongCredentials("qaz@gmail.com", "123");
	 assertEquals("No account found for that email.", loginPage.errorWrongEmail.getText());
		
		

	
}

} 

